package com.itheima;

import com.itheima.model.Employee;
import com.itheima.service.EmployeeService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringbootMapperApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(SpringbootMapperApplication.class, args);

        EmployeeService employeeService = (EmployeeService) context.getBean(EmployeeService.class);
        Employee employee = new Employee(1, null, null, null);
        //System.out.println(employeeService.getEmployee(employee));
        //System.out.println(employeeService.selectEmployeeById(3));
        employee = new Employee(null, "", 1600.00, 22);
        employeeService.saveEmployee(employee);
        System.out.println(employee.getEmpId());
    }

}
